
/**
 * Please modify this class to meet your needs
 * This class is not complete
 */

package org.kallsonys.oms.ws.campaignservices;

import java.util.List;
import java.util.logging.Logger;

import org.kallsonnys.oms.dto.CampaignDTO;
import org.kallsonnys.oms.services.campaigns.CampaignFacadeRemote;
import org.kallsonys.oms.commons.locator.ServiceLocator;
import org.kallsonys.oms.ws.mapper.WSMapper;

import com.integration.kallsonys.kallsonysschema.types.CampaignList;
import com.integration.kallsonys.kallsonysschema.types.PagingDto;

/**
 * This class was generated by Apache CXF 2.6.3
 * 2013-10-27T23:41:57.001-05:00
 * Generated source version: 2.6.3
 * 
 */

@javax.jws.WebService(
                      serviceName = "CampaignServices",
                      portName = "CampaignServicesSOAP",
                      targetNamespace = "http://ws.oms.kallsonys.org/campaignservices",
                      wsdlLocation = "file:/Users/macbook/Documents/BUS-KallsonnysOMS-WS/war/WEB-INF/wsdl/campaignServices.wsdl",
                      endpointInterface = "org.kallsonys.oms.ws.campaignservices.CampaignServices")
                      
public class CampaignServicesImpl implements CampaignServices {

    private static final Logger logger = Logger.getLogger(CampaignServicesImpl.class.getName());

    /* (non-Javadoc)
     * @see org.kallsonys.oms.ws.campaignservices.CampaignServices#getCampaigns(com.integration.kallsonys.kallsonysschema.types.PagingDto  getCampaignsRequest )*
     */
    public CampaignList getCampaigns(PagingDto getCampaignsRequest) throws CampaignsFault    { 
    	try {
    		
    		logger.info("getCampaigns:Operation start");
    		
    		CampaignFacadeRemote campaignFacadeRemote = ServiceLocator.getInstance().getRemoteObject("CampaignBean");
    		List<CampaignDTO> campaignDTOs = campaignFacadeRemote.getCampaigns();
    		
    		CampaignList campaignList = WSMapper.mapCampaignList(campaignDTOs);
    		
    		return campaignList;
			
		} catch (Exception e) {
			throw new CampaignsFault("OCURRIO UN ERROR GENERAL EN LA OPERACION:getCampaigns", e);
		}finally{
			logger.info("getCampaigns:Operation finish");
		}
    }

}
